import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';

class Demo01 extends Component {
  static propTypes = {}
  static defaultProps = {}
  constructor (props) {
    super(props);
    this.state = {
      a: 0
    };
  }
  componentWillMount () {
    console.log('Demo will mount');
  }
  componentDidMount () {
    console.log('Demo did mount');
    const dom = ReactDOM.findDOMNode(this.refs.list);
    console.log(dom);
    console.log(this.node);
    console.log('children', this.props.children);
    console.log('ReactDOM', ReactDOM);
  }
  componentWillUnmount () {}

  componentWillReceiveProps (nextProps) {}
  shouldComponentUpdate (nextProps, nextState) {
    return true;
  }
  componentWillUpdate (nextProps, nextState) {}
  componentDidUpdate (prevProps, prevState) {}
  render () {
    return (
      <div>
        This is a Demo.
        <ul ref="list">
          <li>1</li>
          <li>2</li>
          <li>3</li>
        </ul>
      </div>
    )
  }
}

export default Demo01;
